﻿
Namespace LightSwitchApplication

    Public Class ApplicationDataService

#Region "Asset Information Change Logs"


        Private Sub AssetInformations_Updating(entity As AssetInformation)
            Dim change = entity.AssetInformationChangeLogs.AddNew
            change.ChangeType = "Updated"
            change.Updated = Now()
            change.ChangedBy = Me.Application.User.FullName

            Dim newvals = "New Values:"
            Dim oldvals = "Original Values:"
            For Each prop In entity.Details.Properties.All().
                 OfType(Of Microsoft.LightSwitch.Details.IEntityStorageProperty)()

                If prop.Name <> "Id" Then
                    If Not Object.Equals(prop.Value, prop.OriginalValue) Then
                        oldvals += String.Format("{0}{1}: {2}", ControlChars.Lf, prop.Name, prop.OriginalValue)
                        newvals += String.Format("{0}{1}: {2}", ControlChars.Lf, prop.Name, prop.Value)
                    End If
                End If
            Next

            For Each prop In entity.Details.Properties.All().
                 OfType(Of Microsoft.LightSwitch.Details.IEntityReferenceProperty)()

                If prop.Name <> "Id" Then
                    If Not Object.Equals(prop.Value, prop.OriginalValue) Then
                        oldvals += String.Format("{0}{1}: {2}", ControlChars.Lf, prop.Name, prop.OriginalValue)
                        newvals += String.Format("{0}{1}: {2}", ControlChars.Lf, prop.Name, prop.Value)
                    End If
                End If
            Next


            change.OriginalValues = oldvals
            change.NewValues = newvals

        End Sub

        Private Sub AssetInformations_Inserting(entity As AssetInformation)
            Dim change = entity.AssetInformationChangeLogs.AddNew
            change.ChangeType = "Inserted"
            change.Updated = Now()
            change.ChangedBy = Me.Application.User.FullName

            Dim newvals = "Inserted Values:"
            For Each prop In entity.Details.Properties.All().
                OfType(Of Microsoft.LightSwitch.Details.IEntityStorageProperty)()

                If prop.Name <> "Id" Then
                    newvals += String.Format("{0}{1}: {2}", vbCrLf, prop.Name, prop.Value)
                End If
            Next
            For Each prop In entity.Details.Properties.All().
                OfType(Of Microsoft.LightSwitch.Details.IEntityReferenceProperty)()

                If prop.Name <> "Id" Then
                    newvals += String.Format("{0}{1}: {2}", vbCrLf, prop.Name, prop.Value)
                End If
            Next
            change.NewValues = newvals
        End Sub

        Private Sub AssetInformations_Deleting(entity As AssetInformation)
            Dim change = entity.AssetInformationChangeLogs.AddNew
            change.ChangeType = "Deleted"
            change.Updated = Now()
            change.ChangedBy = Me.Application.User.FullName

            Dim oldvals = "Deleted Values:"
            For Each prop In entity.Details.Properties.All().
                OfType(Of Microsoft.LightSwitch.Details.IEntityStorageProperty)()

                If prop.Name <> "Id" Then
                    oldvals += String.Format("{0}{1}: {2}", vbCrLf, prop.Name, prop.Value)
                End If
            Next

            
            change.OriginalValues = oldvals
        End Sub

#End Region ' --------- Asset Information Change Logs

#Region "Asset Attribute Change Logs"
        Private Sub AssetAttritbutes_Updating(entity As AssetAttritbute)
            'Dim change As New AssetAttributesChangeLog
            Dim change = entity.AssetAttributesChangeLogs.AddNew
            change.ChangeType = "Updated"
            change.Updated = Now()
            change.ChangedBy = Me.Application.User.FullName

            Dim newvals = "New Values:"
            Dim oldvals = "Original Values:"
            For Each prop In entity.Details.Properties.All().
                 OfType(Of Microsoft.LightSwitch.Details.IEntityStorageProperty)()

                If prop.Name <> "Id" Then
                    If Not Object.Equals(prop.Value, prop.OriginalValue) Then
                        oldvals &= String.Format("{0}{1}: {2}", ControlChars.Lf, prop.Name, prop.OriginalValue)
                        newvals &= String.Format("{0}{1}: {2}", ControlChars.Lf, prop.Name, prop.Value)
                    End If
                End If
            Next

            For Each prop In entity.Details.Properties.All().
                 OfType(Of Microsoft.LightSwitch.Details.IEntityReferenceProperty)()

                If prop.Name <> "Id" Then
                    If Not Object.Equals(prop.Value, prop.OriginalValue) Then
                        oldvals &= String.Format("{0}{1}: {2}", ControlChars.Lf, prop.Name, prop.OriginalValue)
                        newvals &= String.Format("{0}{1}: {2}", ControlChars.Lf, prop.Name, prop.Value)
                    End If
                End If
            Next


            change.OriginalValues = oldvals
            change.NewValues = newvals
        End Sub

        Private Sub AssetAttritbutes_Inserting(entity As AssetAttritbute)
            Dim change = entity.AssetAttributesChangeLogs.AddNew
            change.ChangeType = "Inserted"
            change.Updated = Now()
            change.ChangedBy = Me.Application.User.FullName

            Dim newvals = "Inserted Values:"
            For Each prop In entity.Details.Properties.All().
                OfType(Of Microsoft.LightSwitch.Details.IEntityStorageProperty)()

                If prop.Name <> "Id" Then
                    newvals += String.Format("{0}{1}: {2}", vbCrLf, prop.Name, prop.Value)
                End If
            Next
            For Each prop In entity.Details.Properties.All().
                OfType(Of Microsoft.LightSwitch.Details.IEntityReferenceProperty)()

                If prop.Name <> "Id" Then
                    newvals += String.Format("{0}{1}: {2}", vbCrLf, prop.Name, prop.Value)
                End If
            Next
            change.NewValues = newvals
        End Sub

        Private Sub AssetAttritbutes_Deleting(entity As AssetAttritbute)
            Dim change = entity.AssetAttributesChangeLogs.AddNew
            change.ChangeType = "Deleted"
            change.Updated = Now()
            change.ChangedBy = Me.Application.User.FullName

            Dim oldvals = "Deleted Values:"
            For Each prop In entity.Details.Properties.All().
                OfType(Of Microsoft.LightSwitch.Details.IEntityStorageProperty)()

                If prop.Name <> "Id" Then
                    oldvals += String.Format("{0}{1}: {2}", vbCrLf, prop.Name, prop.Value)
                End If
            Next

           
            change.OriginalValues = oldvals
        End Sub
#End Region '  ---------- Asset Attribute Change Logs

#Region "Associates Change Logs"
        Private Sub AssociatesSet_Updating(entity As Associates)
            Dim change = entity.AssociatesChangeLogs.AddNew
            change.ChangeType = "Updated"
            change.Associates = entity
            change.Updated = Now()
            change.ChangedBy = Me.Application.User.FullName

            Dim newvals = "New Values:"
            Dim oldvals = "Original Values:"
            For Each prop In entity.Details.Properties.All().
                 OfType(Of Microsoft.LightSwitch.Details.IEntityStorageProperty)()

                If prop.Name <> "Id" Then
                    If Not Object.Equals(prop.Value, prop.OriginalValue) Then
                        oldvals &= String.Format("{0}{1}: {2}", ControlChars.Lf, prop.Name, prop.OriginalValue)
                        newvals &= String.Format("{0}{1}: {2}", ControlChars.Lf, prop.Name, prop.Value)
                    End If
                End If
            Next

            For Each prop In entity.Details.Properties.All().
                 OfType(Of Microsoft.LightSwitch.Details.IEntityReferenceProperty)()

                If prop.Name <> "Id" Then
                    If Not Object.Equals(prop.Value, prop.OriginalValue) Then
                        oldvals &= String.Format("{0}{1}: {2}", ControlChars.Lf, prop.Name, prop.OriginalValue)
                        newvals &= String.Format("{0}{1}: {2}", ControlChars.Lf, prop.Name, prop.Value)
                    End If
                End If
            Next


            change.OriginalValues = oldvals
            change.NewValues = newvals
        End Sub

        Private Sub AssociatesSet_Inserting(entity As Associates)
            Dim change = entity.AssociatesChangeLogs.AddNew
            change.ChangeType = "Inserted"
            change.Updated = Now()
            change.Associates = entity
            change.ChangedBy = Me.Application.User.FullName

            Dim newvals = "Inserted Values:"
            For Each prop In entity.Details.Properties.All().
                OfType(Of Microsoft.LightSwitch.Details.IEntityStorageProperty)()

                If prop.Name <> "Id" Then
                    newvals += String.Format("{0}{1}: {2}", vbCrLf, prop.Name, prop.Value)
                End If
            Next
            For Each prop In entity.Details.Properties.All().
                OfType(Of Microsoft.LightSwitch.Details.IEntityReferenceProperty)()

                If prop.Name <> "Id" Then
                    newvals += String.Format("{0}{1}: {2}", vbCrLf, prop.Name, prop.Value)
                End If
            Next
            change.NewValues = newvals
        End Sub

        Private Sub AssociatesSet_Deleting(entity As Associates)
            Dim change = entity.AssociatesChangeLogs.AddNew
            change.ChangeType = "Deleted"
            change.Updated = Now()
            change.ChangedBy = Me.Application.User.FullName

            Dim oldvals = "Deleted Values:"
            For Each prop In entity.Details.Properties.All().
                OfType(Of Microsoft.LightSwitch.Details.IentityStorageProperty )()

                If prop.Name <> "Id" Then
                    oldvals += String.Format("{0}{1}: {2}", vbCrLf, prop.Name, prop.Value)
                End If
            Next
            change.OriginalValues = oldvals
        End Sub
#End Region ' ---------- Associates Change Logs

#Region "Company Information Change Logs"
        Private Sub CompanyInformations_Inserting(entity As CompanyInformation)
            Dim change = entity.CompanyInformationChangeLog.AddNew
            change.ChangeType = "Inserted"
            change.Updated = Now()
            change.ChangedBy = Me.Application.User.FullName

            Dim newvals = "Inserted Values:"
            For Each prop In entity.Details.Properties.All().
                OfType(Of Microsoft.LightSwitch.Details.IEntityStorageProperty)()

                If prop.Name <> "Id" Then
                    newvals += String.Format("{0}{1}: {2}", vbCrLf, prop.Name, prop.Value)
                End If
            Next
            For Each prop In entity.Details.Properties.All().
                OfType(Of Microsoft.LightSwitch.Details.IEntityReferenceProperty)()

                If prop.Name <> "Id" Then
                    newvals += String.Format("{0}{1}: {2}", vbCrLf, prop.Name, prop.Value)
                End If
            Next
            change.NewValues = newvals
        End Sub

        Private Sub CompanyInformations_Updating(entity As CompanyInformation)
            Dim change = entity.CompanyInformationChangeLog.AddNew
            change.ChangeType = "Updated"
            change.Updated = Now()
            change.ChangedBy = Me.Application.User.FullName

            Dim newvals = "New Values:"
            Dim oldvals = "Original Values:"
            For Each prop In entity.Details.Properties.All().
                 OfType(Of Microsoft.LightSwitch.Details.IEntityStorageProperty)()

                If prop.Name <> "Id" Then
                    If Not Object.Equals(prop.Value, prop.OriginalValue) Then
                        oldvals &= String.Format("{0}{1}: {2}", ControlChars.Lf, prop.Name, prop.OriginalValue)
                        newvals &= String.Format("{0}{1}: {2}", ControlChars.Lf, prop.Name, prop.Value)
                    End If
                End If
            Next

            For Each prop In entity.Details.Properties.All().
                 OfType(Of Microsoft.LightSwitch.Details.IEntityReferenceProperty)()

                If prop.Name <> "Id" Then
                    If Not Object.Equals(prop.Value, prop.OriginalValue) Then
                        oldvals &= String.Format("{0}{1}: {2}", ControlChars.Lf, prop.Name, prop.OriginalValue)
                        newvals &= String.Format("{0}{1}: {2}", ControlChars.Lf, prop.Name, prop.Value)
                    End If
                End If
            Next


            change.OriginalValues = oldvals
            change.NewValues = newvals
        End Sub

        Private Sub CompanyInformations_Deleting(entity As CompanyInformation)
            Dim change = entity.CompanyInformationChangeLog.AddNew
            change.ChangeType = "Deleted"
            change.Updated = Now()
            change.ChangedBy = Me.Application.User.FullName

            Dim oldvals = "Deleted Values:"
            For Each prop In entity.Details.Properties.All().
                OfType(Of Microsoft.LightSwitch.Details.IEntityStorageProperty)()

                If prop.Name <> "Id" Then
                    oldvals += String.Format("{0}{1}: {2}", vbCrLf, prop.Name, prop.Value)
                End If
            Next

           
            change.OriginalValues = oldvals
        End Sub
#End Region ' ---------- Company Information Change Logs

#Region "Customer Information Change Logs"

        Private Sub CustomerInformations_Inserting(entity As CustomerInformation)
            Dim change = entity.CustomerInformationChangeLogs.AddNew
            change.ChangeType = "Inserted"
            change.Updated = Now()
            change.ChangedBy = Me.Application.User.FullName

            Dim newvals = "Inserted Values:"
            For Each prop In entity.Details.Properties.All().
                OfType(Of Microsoft.LightSwitch.Details.IEntityStorageProperty)()

                If prop.Name <> "Id" Then
                    newvals += String.Format("{0}{1}: {2}", vbCrLf, prop.Name, prop.Value)
                End If
            Next
            For Each prop In entity.Details.Properties.All().
                OfType(Of Microsoft.LightSwitch.Details.IEntityReferenceProperty)()

                If prop.Name <> "Id" Then
                    newvals += String.Format("{0}{1}: {2}", vbCrLf, prop.Name, prop.Value)
                End If
            Next
            change.NewValues = newvals
        End Sub

        Private Sub CustomerInformations_Updating(entity As CustomerInformation)
            Dim change = entity.CustomerInformationChangeLogs.AddNew
            change.ChangeType = "Updated"
            change.Updated = Now()
            change.ChangedBy = Me.Application.User.FullName

            Dim newvals = "New Values:"
            Dim oldvals = "Original Values:"
            For Each prop In entity.Details.Properties.All().
                 OfType(Of Microsoft.LightSwitch.Details.IEntityStorageProperty)()

                If prop.Name <> "Id" Then
                    If Not Object.Equals(prop.Value, prop.OriginalValue) Then
                        oldvals &= String.Format("{0}{1}: {2}", ControlChars.Lf, prop.Name, prop.OriginalValue)
                        newvals &= String.Format("{0}{1}: {2}", ControlChars.Lf, prop.Name, prop.Value)
                    End If
                End If
            Next

            For Each prop In entity.Details.Properties.All().
                 OfType(Of Microsoft.LightSwitch.Details.IEntityReferenceProperty)()

                If prop.Name <> "Id" Then
                    If Not Object.Equals(prop.Value, prop.OriginalValue) Then
                        oldvals &= String.Format("{0}{1}: {2}", ControlChars.Lf, prop.Name, prop.OriginalValue)
                        newvals &= String.Format("{0}{1}: {2}", ControlChars.Lf, prop.Name, prop.Value)
                    End If
                End If
            Next


            change.OriginalValues = oldvals
            change.NewValues = newvals
        End Sub

        Private Sub CustomerInformations_Deleting(entity As CustomerInformation)
            Dim change = entity.CustomerInformationChangeLogs.AddNew
            change.ChangeType = "Deleted"
            change.Updated = Now()
            change.ChangedBy = Me.Application.User.FullName

            Dim oldvals = "Deleted Values:"
            For Each prop In entity.Details.Properties.All().
                OfType(Of Microsoft.LightSwitch.Details.IEntityStorageProperty)()

                If prop.Name <> "Id" Then
                    oldvals += String.Format("{0}{1}: {2}", vbCrLf, prop.Name, prop.Value)
                End If
            Next

           
            change.OriginalValues = oldvals
        End Sub
#End Region ' ---------- Customer Information Change Logs

#Region "Credit Card Information Change Logs"
        Private Sub CCIs_Inserting(entity As CCI)
            Dim change = entity.CCIChangeLogs.AddNew
            change.ChangeType = "Inserted"
            change.Updated = Now()
            change.ChangedBy = Me.Application.User.FullName

            Dim newvals = "Inserted Values:"
            For Each prop In entity.Details.Properties.All().
                OfType(Of Microsoft.LightSwitch.Details.IEntityStorageProperty)()

                If prop.Name <> "Id" Then
                    newvals += String.Format("{0}{1}: {2}", vbCrLf, prop.Name, prop.Value)
                End If
            Next
            For Each prop In entity.Details.Properties.All().
                OfType(Of Microsoft.LightSwitch.Details.IEntityReferenceProperty)()

                If prop.Name <> "Id" Then
                    newvals += String.Format("{0}{1}: {2}", vbCrLf, prop.Name, prop.Value)
                End If
            Next
            change.NewValues = newvals
        End Sub

        Private Sub CCIs_Updating(entity As CCI)
            Dim change = entity.CCIChangeLogs.AddNew
            change.ChangeType = "Updated"
            change.Updated = Now()
            change.ChangedBy = Me.Application.User.FullName

            Dim newvals = "New Values:"
            Dim oldvals = "Original Values:"
            For Each prop In entity.Details.Properties.All().
                 OfType(Of Microsoft.LightSwitch.Details.IEntityStorageProperty)()

                If prop.Name <> "Id" Then
                    If Not Object.Equals(prop.Value, prop.OriginalValue) Then
                        oldvals &= String.Format("{0}{1}: {2}", ControlChars.Lf, prop.Name, prop.OriginalValue)
                        newvals &= String.Format("{0}{1}: {2}", ControlChars.Lf, prop.Name, prop.Value)
                    End If
                End If
            Next

            For Each prop In entity.Details.Properties.All().
                 OfType(Of Microsoft.LightSwitch.Details.IEntityReferenceProperty)()

                If prop.Name <> "Id" Then
                    If Not Object.Equals(prop.Value, prop.OriginalValue) Then
                        oldvals &= String.Format("{0}{1}: {2}", ControlChars.Lf, prop.Name, prop.OriginalValue)
                        newvals &= String.Format("{0}{1}: {2}", ControlChars.Lf, prop.Name, prop.Value)
                    End If
                End If
            Next


            change.OriginalValues = oldvals
            change.NewValues = newvals
        End Sub

        Private Sub CCIs_Deleting(entity As CCI)
            Dim change = entity.CCIChangeLogs.AddNew
            change.ChangeType = "Deleted"
            change.Updated = Now()
            change.ChangedBy = Me.Application.User.FullName

            Dim oldvals = "Deleted Values:"
            For Each prop In entity.Details.Properties.All().
                OfType(Of Microsoft.LightSwitch.Details.IEntityStorageProperty)()

                If prop.Name <> "Id" Then
                    oldvals += String.Format("{0}{1}: {2}", vbCrLf, prop.Name, prop.Value)
                End If
            Next

           
            change.OriginalValues = oldvals
        End Sub
#End Region ' ---------- Credit Card Information Change Logs

#Region "Rental And Checkout Change Log"

        Private Sub RentalCheckouts_Inserting(entity As RentalCheckout)
            Dim change = entity.RentalCheckoutChangeLog.AddNew
            change.ChangeType = "Inserted"
            change.Updated = Now()
            change.ChangedBy = Me.Application.User.FullName

            Dim newvals = "Inserted Values:"
            For Each prop In entity.Details.Properties.All().
                OfType(Of Microsoft.LightSwitch.Details.IEntityStorageProperty)()

                If prop.Name <> "Id" Then
                    newvals += String.Format("{0}{1}: {2}", vbCrLf, prop.Name, prop.Value)
                End If
            Next
            For Each prop In entity.Details.Properties.All().
                OfType(Of Microsoft.LightSwitch.Details.IEntityReferenceProperty)()

                If prop.Name <> "Id" Then
                    newvals += String.Format("{0}{1}: {2}", vbCrLf, prop.Name, prop.Value)
                End If
            Next
            change.NewValues = newvals
        End Sub

        Private Sub RentalCheckouts_Deleting(entity As RentalCheckout)
            Dim change = entity.RentalCheckoutChangeLog.AddNew
            change.ChangeType = "Deleted"
            change.Updated = Now()
            change.ChangedBy = Me.Application.User.FullName

            Dim oldvals = "Deleted Values:"
            For Each prop In entity.Details.Properties.All().
                OfType(Of Microsoft.LightSwitch.Details.IEntityStorageProperty)()

                If prop.Name <> "Id" Then
                    oldvals += String.Format("{0}{1}: {2}", vbCrLf, prop.Name, prop.Value)
                End If
            Next

            change.OriginalValues = oldvals
        End Sub

        Private Sub RentalCheckouts_Updating(entity As RentalCheckout)
            Dim change = entity.RentalCheckoutChangeLog.AddNew
            change.ChangeType = "Updated"
            change.Updated = Now()
            change.ChangedBy = Me.Application.User.FullName

            Dim newvals = "New Values:"
            Dim oldvals = "Original Values:"
            For Each prop In entity.Details.Properties.All().
                 OfType(Of Microsoft.LightSwitch.Details.IEntityStorageProperty)()

                If prop.Name <> "Id" Then
                    If Not Object.Equals(prop.Value, prop.OriginalValue) Then
                        oldvals &= String.Format("{0}{1}: {2}", ControlChars.Lf, prop.Name, prop.OriginalValue)
                        newvals &= String.Format("{0}{1}: {2}", ControlChars.Lf, prop.Name, prop.Value)
                    End If
                End If
            Next

            For Each prop In entity.Details.Properties.All().
                 OfType(Of Microsoft.LightSwitch.Details.IEntityReferenceProperty)()

                If prop.Name <> "Id" Then
                    If Not Object.Equals(prop.Value, prop.OriginalValue) Then
                        oldvals &= String.Format("{0}{1}: {2}", ControlChars.Lf, prop.Name, prop.OriginalValue)
                        newvals &= String.Format("{0}{1}: {2}", ControlChars.Lf, prop.Name, prop.Value)
                    End If
                End If
            Next


            change.OriginalValues = oldvals
            change.NewValues = newvals
        End Sub
#End Region ' ---------- Rental And Checkout Change Log

#Region "Reservations Change Log"

        Private Sub ReservationsSet_Inserting(entity As Reservations)
            Dim change = entity.ReservationChangeLogs.AddNew
            change.ChangeType = "Inserted"
            change.Updated = Now()
            change.ChangedBy = Me.Application.User.FullName

            Dim newvals = "Inserted Values:"
            For Each prop In entity.Details.Properties.All().
                OfType(Of Microsoft.LightSwitch.Details.IEntityStorageProperty)()

                If prop.Name <> "Id" Then
                    newvals += String.Format("{0}{1}: {2}", vbCrLf, prop.Name, prop.Value)
                End If
            Next
            For Each prop In entity.Details.Properties.All().
                OfType(Of Microsoft.LightSwitch.Details.IEntityReferenceProperty)()

                If prop.Name <> "Id" Then
                    newvals += String.Format("{0}{1}: {2}", vbCrLf, prop.Name, prop.Value)
                End If
            Next
            change.NewValues = newvals
        End Sub

        Private Sub ReservationsSet_Deleting(entity As Reservations)
            Dim change = entity.ReservationChangeLogs.AddNew
            change.ChangeType = "Deleted"
            change.Updated = Now()
            change.ChangedBy = Me.Application.User.FullName

            Dim oldvals = "Deleted Values:"
            For Each prop In entity.Details.Properties.All().
                OfType(Of Microsoft.LightSwitch.Details.IEntityStorageProperty)()

                If prop.Name <> "Id" Then
                    oldvals += String.Format("{0}{1}: {2}", vbCrLf, prop.Name, prop.Value)
                End If
            Next

            
            change.OriginalValues = oldvals
        End Sub

        Private Sub ReservationsSet_Updating(entity As Reservations)
            Dim change = entity.ReservationChangeLogs.AddNew
            change.ChangeType = "Updated"
            change.Updated = Now()
            change.ChangedBy = Me.Application.User.FullName

            Dim newvals = "New Values:"
            Dim oldvals = "Original Values:"
            For Each prop In entity.Details.Properties.All().
                 OfType(Of Microsoft.LightSwitch.Details.IEntityStorageProperty)()

                If prop.Name <> "Id" Then
                    If Not Object.Equals(prop.Value, prop.OriginalValue) Then
                        oldvals &= String.Format("{0}{1}: {2}", ControlChars.Lf, prop.Name, prop.OriginalValue)
                        newvals &= String.Format("{0}{1}: {2}", ControlChars.Lf, prop.Name, prop.Value)
                    End If
                End If
            Next

            For Each prop In entity.Details.Properties.All().
                 OfType(Of Microsoft.LightSwitch.Details.IEntityReferenceProperty)()

                If prop.Name <> "Id" Then
                    If Not Object.Equals(prop.Value, prop.OriginalValue) Then
                        oldvals &= String.Format("{0}{1}: {2}", ControlChars.Lf, prop.Name, prop.OriginalValue)
                        newvals &= String.Format("{0}{1}: {2}", ControlChars.Lf, prop.Name, prop.Value)
                    End If
                End If
            Next


            change.OriginalValues = oldvals
            change.NewValues = newvals
        End Sub

#End Region ' ---------- Reservations Change Log
        
        

        Private Sub AssetsNotCheckedOut_PreprocessQuery(ByRef query As System.Linq.IQueryable(Of LightSwitchApplication.AssetInformation))
            query = query.Where(Function(x) x.RentalCheckouts.Where(Function(y) y.DateIn Is Nothing).Count = 0)
        End Sub

      
      

       
    End Class

End Namespace
